package com.rm.freedrawview;

import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;

/**
 * Created by Riccardo Moro on 9/25/2016.
 *
 * @author author
 * @version version
 */
public class Point implements Sequenceable, Serializable {

    static final long serialVersionUID = 42L;

    float x;
    float y;

    Point() {
        x = y = -1;
    }

    @Override
    public String toString() {
        return "" + x + " : " + y + " - ";
    }


    private Point(Parcel in) {
        x = in.readFloat();
        y = in.readFloat();
    }


    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeFloat(x);
        parcel.writeFloat(y);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        x = parcel.readFloat();
        y = parcel.readFloat();
        return true;
    }
}
